package nc.ui.arap.report.asyn.task;

import java.util.Arrays;

import nc.bs.pub.taskcenter.AbstractReportLikeWork;
import nc.ui.pub.ClientEnvironment;
import nc.vo.arap.pub.QueryStructVO;

public abstract class AbstractAsynTask extends AbstractReportLikeWork {

	/**
	 * 
	 */
	private static final long serialVersionUID = 9075544796329828883L;
	
	protected QueryStructVO voStruct;
	
	public AbstractAsynTask(QueryStructVO voStruct) {
		setCreator(ClientEnvironment.getInstance().getUser().getPrimaryKey());
		setfuncCode(getNode(voStruct.getSysFlag()[0]));
		setPk_corp(ClientEnvironment.getInstance().getCorporation().getPk_corp());
		setWorkName(voStruct.getQueryTypeInfo().getResultName());
		getReportLikeWorkInfo().getMsgReceivers().addAll(Arrays.asList(voStruct.getQueryTypeInfo().getReceivers()));
		this.voStruct = voStruct;
	}
	
	protected abstract String getNode(int sysflag);
}
